package com.company.modules.project.entity;

import java.io.Serializable;

/**
 * 系统管理员
 * @TableName system_admin
 */
public class SystemAdmin implements Serializable {
    /**
     * ID标识
     */
    private Integer id;

    /**
     * 登录账号;为避免产生数据混淆，仅记录手机号
     */
    private String loginAccount;

    /**
     * 密码
     */
    private String password;

    /**
     * 加盐值
     */
    private String salt;

    /**
     * 头像路径;头像路径，用于登录之后显示
     */
    private String avatarUrl;

    private static final long serialVersionUID = 1L;

    /**
     * ID标识
     */
    public Integer getId() {
        return id;
    }

    /**
     * ID标识
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 登录账号;为避免产生数据混淆，仅记录手机号
     */
    public String getLoginAccount() {
        return loginAccount;
    }

    /**
     * 登录账号;为避免产生数据混淆，仅记录手机号
     */
    public void setLoginAccount(String loginAccount) {
        this.loginAccount = loginAccount;
    }

    /**
     * 密码
     */
    public String getPassword() {
        return password;
    }

    /**
     * 密码
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * 加盐值
     */
    public String getSalt() {
        return salt;
    }

    /**
     * 加盐值
     */
    public void setSalt(String salt) {
        this.salt = salt;
    }

    /**
     * 头像路径;头像路径，用于登录之后显示
     */
    public String getAvatarUrl() {
        return avatarUrl;
    }

    /**
     * 头像路径;头像路径，用于登录之后显示
     */
    public void setAvatarUrl(String avatarUrl) {
        this.avatarUrl = avatarUrl;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SystemAdmin other = (SystemAdmin) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getLoginAccount() == null ? other.getLoginAccount() == null : this.getLoginAccount().equals(other.getLoginAccount()))
            && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
            && (this.getSalt() == null ? other.getSalt() == null : this.getSalt().equals(other.getSalt()))
            && (this.getAvatarUrl() == null ? other.getAvatarUrl() == null : this.getAvatarUrl().equals(other.getAvatarUrl()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getLoginAccount() == null) ? 0 : getLoginAccount().hashCode());
        result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
        result = prime * result + ((getSalt() == null) ? 0 : getSalt().hashCode());
        result = prime * result + ((getAvatarUrl() == null) ? 0 : getAvatarUrl().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", loginAccount=").append(loginAccount);
        sb.append(", password=").append(password);
        sb.append(", salt=").append(salt);
        sb.append(", avatarUrl=").append(avatarUrl);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
